package com.example.gw_back_end.controller;

import com.example.gw_back_end.domain.Result;
import com.example.gw_back_end.domain.SearchParams;
import com.example.gw_back_end.service.provider.SearchService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("search")
public class SearchController {
    private final SearchService searchService;

    public SearchController(SearchService searchService) {
        this.searchService = searchService;
    }

    @PostMapping
    public Result search(@RequestBody SearchParams searchParams) {
         return Result.success(searchService.search(searchParams));
    }
}
